package com.example.cshaoshao.demo.entities;

import android.os.Handler;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by cshaoshao on 2017/6/26.
 */

public class Info
{
    private CallParm callParm;
    private List<String> list=new ArrayList<>();
    private Handler handler=new Handler();
    public Info(CallParm callParm) {
        this.callParm=callParm;
    }
    public void getData()
    {
        try {
            for (int i = 'a'; i <'z' ; i++) {

                list.add(String.valueOf(i));
            }
            handler.post(new Runnable() {
                @Override
                public void run()
                {
                    if (callParm!=null)
                    {
                        callParm.successful(list);
                    }
                }
            });

        } catch (final Exception e) {
            e.printStackTrace();
            handler.post(new Runnable() {
                @Override
                public void run() {
                    if (callParm!=null)
                    {
                        callParm.failed(e.getMessage());
                    }
                }
            });

        }
    }
}
